<%--
  Created by IntelliJ IDEA.
  User: 12822
  Date: 2023/12/9
  Time: 17:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="Dao.ShopWay" %>
<%@ page import="Dao.Shop" %>
<%@ page import="java.util.ArrayList" %>
<html>
<head>
    <title>购物车</title>
    <link href="color.css" rel="stylesheet">
</head>
<body background="pic/buy.png">
<% String name= (String) request.getSession().getAttribute("name"); %>
<div class="buy1">
<table>
    <tr>
        <th>名称</th>
        <th>价格</th>
        <th>购买数量</th>
    </tr>
    <% ShopWay shopWay = new ShopWay();
        ArrayList<Shop> shopArrayList=new ArrayList<Shop>();
        shopArrayList = shopWay.getAll(name);
        for (Shop shop : shopArrayList) {
    %>

    <tr>
        <td><%= shop.getName() %></td>
        <td><%= shop.getPrice() %></td>
        <td><%= shop.getNumber() %></td>
    </tr>
    <% } %>
</table>
<%= shopWay.getAllPrice(name)%>
    </div>
<a href="shopping.jsp" class="BuyAndShow">前往商城</a>
</body>
</html>
